#pragma once
#include "refc_ptr.h"
#include "audio_types.h"

namespace krryn{
namespace audio{
	// the data stored in this class is
	// floating point data in the range [-1, 1]
	class sample{
	public:
		typedef core::refc_ptr<sample> ptr;
		typedef float value_type;

		sample(int a_Frequency);
		~sample();

		void allocate(int a_NumberOfSamples);
		value_type *buffer() const;
		
		void set_count(int a_Count);
		void set_pan(float a_Pan);
		void set_volume(float a_Volume);

		int count() const;
		int sample_rate() const;
		float pan() const;
		float volume() const;
	private:
		int m_Count;
		int m_SampleRate;
		float m_Pan;
		float m_Volume;
		value_type *m_Data;
	};
}
}
